<?php

class MaterialesTipo extends AppModel {

    var $name = 'MaterialesTipo';
    var $displayField = 'id';
    var $validate = array(
        'id' => array(
            'notempty' => array(
                'rule' => array('notempty'),
                'message' => 'Campo requerido',
            ),
            'numeric' => array(
                'rule' => array('numeric'),
                'message' => 'Campo inválido',
            ),
        ),
        'tipo' => array(
            'notempty' => array(
                'rule' => array('notempty'),
                'message' => 'Campo requerido',
            ),
            'inlist' => array(
                'rule' => array('inlist', array('Simple', 'Mixto')),
                'message' => 'Campo inválido',
                'last' => true,
            ),
        ),
        'materiale_id' => array(
            'notempty' => array(
                'rule' => array('notempty'),
                'message' => 'Campo requerido',
            ),
            'numeric' => array(
                'rule' => array('numeric'),
                'message' => 'Campo inválido',
            ),
        ),
        'secundario' => array(
            'numeric' => array(
                'rule' => array('numeric'),
                'message' => 'Campo inválido',
            ),
        ),
    );
    //The Associations below have been created with all possible keys, those that are not needed can be removed
    var $hasMany = array(
        'Obra' => array(
            'className' => 'Obra',
            'foreignKey' => 'materiales_tipo_id',
            'dependent' => false,
            'conditions' => '',
            'fields' => '',
            'order' => '',
            'limit' => '',
            'offset' => '',
            'exclusive' => '',
            'finderQuery' => '',
            'counterQuery' => ''
        )
    );
    var $belongsTo = array(
        'Materiale' => array(
            'className' => 'Materiale',
            'foreignKey' => 'materiale_id',
            'conditions' => '',
            'fields' => '',
            'order' => ''
        )
    );

}
?>